/* SyncTaskForm 样式文件 */

.data-sync-task-container {
  padding: 20px;
  background-color: #f8fafc;
}

.page-header {
  margin-bottom: 24px;
  border-bottom: 2px solid #e0e7f1;
  padding-bottom: 12px;
}

.page-title {
  font-size: 22px;
  color: #2c3e50;
  font-weight: 600;
}

.sync-form {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 24px;
}

.form-section {
  margin-bottom: 30px;
  background-color: #fff;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #ebeef5;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

.section-header {
  padding: 14px 20px;
  background: linear-gradient(to right, #f0f5ff, #f8fafc);
  border-bottom: 1px solid #e0e7f1;
}

.section-title {
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.section-icon {
  margin-right: 10px;
  color: #409EFF;
  font-size: 18px;
}

.section-content {
  padding: 20px;
}

/* 表单操作按钮区域 */
.form-actions {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  padding: 20px 0;
  gap: 20px;
}

/* 对话框进入动画 */
@keyframes dialog-enter {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 字段映射表格样式 */
:deep(.el-table) {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);

  .el-table__header {
    background: linear-gradient(145deg, #f0f5ff, #f5f7fa);
  }

  .el-table__row {
    transition: background-color 0.3s ease;

    &:hover {
      background-color: rgba(64, 158, 255, 0.08);
    }
  }
}

/* 选择器悬停效果 */
:deep(.el-select:hover .el-input__wrapper) {
  box-shadow: 0 0 0 1px #409EFF inset;
}

:deep(.el-select-dropdown__item) {
  transition: background-color 0.2s ease;

  &.selected {
    background: linear-gradient(90deg, rgba(64, 158, 255, 0.1), rgba(64, 158, 255, 0.2));
    font-weight: 600;
  }

  &:hover {
    background: linear-gradient(90deg, rgba(64, 158, 255, 0.05), rgba(64, 158, 255, 0.15));
  }
}

.target-field-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;

  .warning-icon {
    color: #F56C6C;
    margin-left: 5px;
    font-size: 16px;
    cursor: help;
  }
}

.hdfs-field-management {
  margin-top: 20px;
  padding: 16px;
  background-color: #fff;
  border-radius: 4px;
  border: 1px solid #ebeef5;

  .field-management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;

    .field-management-actions {
      display: flex;
      gap: 10px;

      .el-input {
        width: 220px;
      }
    }
  }

  .pagination-container {
    margin-top: 16px;
    text-align: right;
  }
}

.field-mapping-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.field-header-actions {
  display: flex;
  gap: 10px;
}

.field-header-filter {
  position: relative;
  width: 200px;
}

.field-mapping-table {
  margin-top: 16px;
}

.hdfs-browser-dialog .el-dialog__body {
  padding: 0;
}

.hdfs-browser-container {
  display: flex;
  flex-direction: column;
  height: 70vh;
  overflow: hidden;
}

.browser-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #ebeef5;
  background-color: #f0f5ff;
}

.browser-path {
  flex: 1;
}

.browser-path .el-breadcrumb__item {
  cursor: pointer;
}

.browser-path .el-breadcrumb__item:hover .el-breadcrumb__inner {
  color: #409eff;
}

.browser-actions {
  display: flex;
  gap: 16px;
}

.browser-content {
  flex: 1;
  overflow: auto;
  padding: 16px;
}

.browser-content.grid .file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
}

.file-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.file-item:hover {
  background-color: rgba(64, 158, 255, 0.1);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.file-item.is-folder .file-icon {
  color: #e6a23c;
}

.file-icon {
  font-size: 36px;
  color: #409EFF;
  margin-bottom: 8px;
}

.file-name {
  font-size: 14px;
  text-align: center;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 源数据库和目标数据库左右布局 */
.database-container {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.source-.target-database {
  flex: 1;
  min-width: 0;
}

.source-database .section-header {
  background: linear-gradient(to right, #e4f0ff, #f0f7ff);
  border-bottom: 1px solid #d2e3fc;
}

.target-database .section-header {
  background: linear-gradient(to right, #e7f5ec, #f0f9f4);
  border-bottom: 1px solid #d1e7db;
}

.source-database .section-icon {
  color: #4B7BE5;
}

.target-database .section-icon {
  color: #10B981;
}

.mapping-section {
  margin-top: 20px;
}

/* 响应式调整 */
@media screen and (max-width: 1280px) {
  .database-container {
    flex-direction: column;
  }

  .source-.target-database {
    width: 100%;
  }
}

/* 数据映射列表样式 */
.mapping-table-container {
  margin-top: 20px;
  border: 1px solid #ebeef5;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mapping-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(to right, #f0f5ff, #f8fafc);
  border-bottom: 1px solid #e0e7f1;
}

.mapping-title {
  font-weight: 500;
  color: #303133;
  display: flex;
  align-items: center;
}

.mapping-title .el-icon {
  margin-right: 8px;
  color: #4B7BE5;
}

.mapping-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-header {
  display: flex;
  background-color: #f5f7fa;
  border-bottom: 1px solid #ebeef5;
  font-weight: 600;
  font-size: 13px;
}

.table-body {
  max-height: 350px;
  overflow-y: auto;
  font-size: 13px;
}

.table-row {
  display: flex;
  border-bottom: 1px solid #ebeef5;
  transition: background-color 0.3s;
  background-color: #fff;
  line-height: 1.3;
}

.table-row:last-child {
  border-bottom: none;
}

.table-row:hover {
  background-color: #f5f7fa;
}

.table-cell {
  padding: 8px 6px;
  display: flex;
  align-items: center;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.table-cell:not(:last-child) {
  border-right: 1px solid #ebeef5;
}

.field-with-type {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  min-width: 0;
}

.field-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-type {
  font-size: 12px;
  padding: 2px 6px;
  background-color: #f0f2f5;
  border-radius: 4px;
  color: #909399;
  white-space: nowrap;
}

.source-field {
  color: #4B7BE5;
}

.target-field {
  color: #10B981;
}

.mapping-tips {
  margin-top: 16px;
  padding: 12px;
  background-color: #ecf5ff;
  border-radius: 6px;
  color: #606266;
}

.mapping-tips p {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  margin-top: 0;
  margin-bottom: 8px;
}

.mapping-tips ul {
  margin: 0;
  padding-left: 28px;
}

.mapping-tips li {
  margin-bottom: 4px;
}

.mapping-tips code {
  background-color: #ffffff;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: monospace;
}

/* 调度策略样式 */
.schedule-options {
  margin-top: 8px;
}

.schedule-radio-group {
  .el-radio-button__inner {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    height: auto;
    min-height: 60px;
    min-width: 150px;
  }
}

.radio-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  
  .el-icon {
    font-size: 24px;
    margin-bottom: 4px;
  }
  
  span {
    font-size: 14px;
  }
}

.frequency-group {
  .el-radio-button__inner {
    padding: 10px 16px;
  }
}

.next-execution-times {
  background-color: #f5f7fa;
  border-radius: 4px;
  padding: 12px;
  
  .execution-time-item {
    margin-bottom: 8px;
    padding: 4px 8px;
    background-color: #e6f1fe;
    border-radius: 3px;
    display: inline-block;
    margin-right: 10px;
    color: #409eff;
    font-size: 13px;
  }
}

/* 修正checkbox样式 */
.el-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  
  .el-checkbox {
    margin-right: 0;
  }
}

/* 表单提示样式 */
.form-tip {
  font-size: 12px;
  color: #909399;
  margin-top: 4px;
}

/* 映射对话框样式 */
.mapping-dialog-header {
  margin-bottom: 20px;
  
  .mapping-info {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    
    .mapping-info-item {
      display: flex;
      align-items: center;
      gap: 8px;
      
      .label {
        color: #606266;
        font-weight: 500;
      }
      
      .value {
        color: #303133;
      }
    }
  }
}

/* 文件预览样式 */
.file-preview-container {
  border: 1px solid #ebeef5;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 8px;
  background: #fff;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}

.file-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background-color: #f5f7fa;
  border-bottom: 1px solid #ebeef5;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-name {
  font-weight: 500;
  color: #303133;
}

.file-size {
  color: #909399;
  font-size: 12px;
}

.file-preview-content {
  padding: 10px 15px;
  max-height: 250px;
  overflow: auto;
  background-color: #fafafa;
}

.file-preview-content pre {
  margin: 0;
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-all;
  color: #333;
  font-size: 13px;
  line-height: 1.5;
} 